package zz;

import java.io.*;
import java.util.HashMap;

public class BufferWR {
    public static void main(String[] args) throws Exception {
        show3();
    }
    public static void show3() throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("c.txt"));
        BufferedWriter bw = new BufferedWriter(new FileWriter("d.txt"));
        HashMap<String, String> map = new HashMap<>();
        String line = null;
        while ((line = br.readLine()) != null) {
            String[] split = line.split("\\.");
            map.put(split[0], split[1]);
        }
        for (String s : map.keySet()) {
            String v = map.get(s);
            line = s + "." + v;
            bw.write(line);
            bw.newLine();
        }
        bw.close();
        br.close();
    }
    public static void show1() throws IOException {
        BufferedWriter bw = new BufferedWriter(new FileWriter("c.txt"));
        for (int i = 0; i < 10; i++) {
            bw.write("八成的蠢");
            bw.newLine();
        }
        bw.close();

    }
    public static void show2() throws Exception{
        BufferedReader br = new BufferedReader(new FileReader("a.txt"));
        String line = null;
        while ((line = br.readLine()) != null) {
            System.out.println(line);
        }
        br.close();
    }
}

